#include "Uniform.h"


Uniform::Uniform(GLint uniformLocation):m_UniformLocation(uniformLocation)
{
}

Uniform::Uniform():m_UniformLocation(-1)
{
}


Uniform::~Uniform(void)
{
}

void Uniform::operator=(float3& v)
{
	glUniform3f(m_UniformLocation,v.x,v.y,v.z);
}

void Uniform::operator=(float2& v)
{
	glUniform2f(m_UniformLocation,v.u,v.v);
}
	
void Uniform::operator=(float p)
{
	glUniform1f(m_UniformLocation,p);
}

void Uniform::operator=(float4x4& matrix)
{
	glUniformMatrix4fv(m_UniformLocation,16,false,matrix.m_M);
}